import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router';

import Container from '@/layouts/container.vue';

const routes: Array<RouteRecordRaw> = [
    {
        path: '/',
        component: Container,
        meta: {
            accessAuth: true
        }
    },
    {
        path: "/:catchAll(.*)",
        redirect: "/"
    }
];

const router = createRouter({
    routes: routes,
    history: createWebHashHistory('./'),
});

// router.beforeEach(async (to, _from, next) => {
//     const userStore = useUserStore();
//     if (to.meta?.accessAuth && !userStore.getToken) {
//         return next('/login');
//     }
//     return next();
// });

export default router;
